package store

import (
	"fmt"
	_ "github.com/go-sql-driver/mysql"
	"xorm.io/xorm"
)

func NewStore(username, password, host, dbname string) (*xorm.Engine, error) {

	engine, err := xorm.NewEngine("mysql", fmt.Sprintf("%s:%s@(%s)/%s?charset=utf8", username, password, host, dbname))

	return engine, err

}
